<?php

namespace App\Http\Requests\API;

use App\Models\StaffOpenid;
use InfyOm\Generator\Request\APIRequest;

class CreateStaffOpenidAPIRequest extends APIRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'uid' => 'required',
            'openid' => 'bail|required',
            // 'nickname' => 'required',
            // 'avatar' => 'required',
        ];
    }

    public function messages(){
        return [
            'uid.required' => '员工ID不正确！',
            'openid.required'  => 'openid 不正确',
            'nickname.required'  => '昵称不正确。',
            'avatar.required'  => '头像不能为空。',
        ];
    }
}
